package ProxyPattern.DynamicProxy;

import ProxyPattern.StaticProxy.buyHouse;
import ProxyPattern.StaticProxy.buyHouseImpl;

import java.lang.reflect.Proxy;

public class Demo {
    public static void main(String[] args) {
        buyHouse buyhouse=new buyHouseImpl();
        buyHouse proxyBuyHOuse =(buyHouse) Proxy.newProxyInstance(buyHouse.class.getClassLoader(),new Class[]{buyHouse.class},new DynamicProxyHandle(buyhouse));
        proxyBuyHOuse.buyHouse();
    }
}
